package com.ntschy.common.valid.time;


import cn.hutool.core.util.StrUtil;

import java.util.regex.Pattern;

public class TimeValidationUtil {

    private static final Pattern PATTERN = Pattern.compile("^(([0-1]{1}[0-9]{1})|([2]{1}[0-4]{1}))([:])(([0-5]{1}[0-9]{1}|[6]{1}[0]{1}))([:])((([0-5]{1}[0-9]{1}|[6]{1}[0]{1})))$");
    /**
     * 验证时间格式 12:11:00
     */
    public static boolean isDate(String date){
        if (StrUtil.isEmpty(date)) {
            return false;
        } else {
            boolean matches = PATTERN.matcher(date).matches();
            return matches;
        }
    }

}
